package com.estate.common.core.domain.req;

import com.estate.common.xss.Xss;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;

/**
 * 用户表 sys_user
 *
 * @author ruoyi
 */
@Data
public class SysUserAddReq implements Serializable
{
    private static final long serialVersionUID = 1L;

    @Xss(message = "User account cannot contain script characters")
    @NotBlank(message = "User account cannot be empty")
    @Size(min = 0, max = 50, message = "User account cannot exceed 50 characters")
    private String userName;

    private String password;

    @Xss(message = "First name cannot contain script characters")
    @Size(min = 0, max = 30, message = "First name cannot exceed 50 characters")
    private String firstName;

    @Xss(message = "Last name cannot contain script characters")
    @Size(min = 0, max = 30, message = "Last name cannot exceed 50 characters")
    private String lastName;

    @Email(message = "Email format is incorrect")
    @NotBlank(message = "Email cannot be empty")
    @Size(min = 0, max = 50, message = "Email cannot exceed 50 characters")
    private String email;

    private String phonenumber;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date birthday;

    private String sex;

    @NotNull(message = "Department cannot be empty")
    private Long deptId;

    private Long teamId;

    @NotNull(message = "Role cannot be empty")
    private Long roleId;

    private String avatar;


}
